/*
 * Projekt: GMU 2013 - Canny hranovy detektor OpenCL/CUDA
 * Autori: Pavel Nevrala - xnevra00 (xnevra00@stud.fit.vutbr.cz)
 *         Martin Jurak - xjurak02 (xjurak02@stud.fit.vutbr.cz)
 */
#pragma once

#include "cannypartsbase.h"
#include "gaussianmask.h"

/*
 * GaussianFilterCL
 * Trida starajici o nastaveni kernelu pro odstraneni sumu Gaussovym separabilnim filtrem
 */
class GaussianFilterCL :
	public CannyPartsBase
{
public:
	GaussianFilterCL(cl_uint maxWorkGroupP,GaussianMask *mask, cl_context *contextP, cl_command_queue *commandQueueP, cl_program *programP);
	~GaussianFilterCL(void);

	/*
	 * Provede nastaveni OpenCl a kernelu pro odstraneni sumu Gaussovym separabilnim filtrem.
	 * @image - vstupni obraz
	 * @width - sirka obrazu
	 * @height - vyska obrazu	
	 * @return - doba vypoctu na GPU
	 */
	virtual double run(cl_float *image, cl_uint width, cl_uint height);

private:
	// kernely pro Gaussov filtr ve smeru X a Y
	cl_kernel kernelGaussX, kernelGaussY;
	// linearni Gaussova maska
	GaussianMask *gaussianMask;
	// opencl contexct
	cl_context *context;
	// command queue
	cl_command_queue *commandQueue;
	// zkompilovny opencl program
	cl_program *program;
};

